Fix for 904065: use .php instead of .phtml extension by default
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 27 Feb 2004 03:59:21 +0000 (03:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 27 Feb 2004 03:59:21 +0000 (03:59 +0000)
includes/DefaultSettings.php
install-utils.inc
install.php
update.php

index 19ab767..ea1515a 100644 (file)
@@ -8,13 +8,17 @@
 
 $wgVersion                     = "1.2.0beta";
 
-$wgSitename         = "Wikipedia";
+$wgSitename         = "MediaWiki"; # Please customize!
 $wgMetaNamespace    = FALSE; # will be same as you set $wgSitename
 
 $wgServer           = "http://" . getenv( "SERVER_NAME" );
 $wgScriptPath      = "/wiki";
-$wgScript           = "{$wgScriptPath}/wiki.phtml";
-$wgRedirectScript   = "{$wgScriptPath}/redirect.phtml";
+
+# Change this and the next two to use "phtml" for compatibility with old installations
+$wgScriptExtension     = "php";
+$wgScript           = "{$wgScriptPath}/wiki.{$wgScriptExtension}";
+$wgRedirectScript   = "{$wgScriptPath}/redirect.{$wgScriptExtension}";
+
 $wgStyleSheetPath   = "{$wgScriptPath}/style";
 $wgStyleSheetDirectory = "{$IP}/style";
 $wgArticlePath      = "{$wgScript}?title=$1";
@@ -25,8 +29,7 @@ $wgMathPath         = "{$wgUploadPath}/math";
 $wgMathDirectory    = "{$wgUploadDirectory}/math";
 $wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
 $wgEmergencyContact = "wikiadmin@" . getenv( "SERVER_NAME" );
-#$wgPasswordSender     = "Wikipedia Mail <apache@www.wikipedia.org>";
-$wgPasswordSender      = "Wikipedia Mail <apache@www.wikipedia.org>\r\nReply-To: webmaster@www.wikipedia.org";
+$wgPasswordSender      = "Wikipedia Mail <apache@" . getenv( "SERVER_NAME" ) . ">";
 
 # MySQL settings
 #
index 2bd3134..8d1734e 100644 (file)
@@ -27,16 +27,20 @@ function install_version_checks() {
 }
 
 function copyfile( $sdir, $name, $ddir, $perms = 0664 ) {
+       copyfileto( $sdir, $name, $ddir, $name, $perms );
+}
+
+function copyfileto( $sdir, $sname, $ddir, $dname, $perms = 0664 ) {
        global $wgInstallOwner, $wgInstallGroup;
 
-       $d = "{$ddir}/{$name}";
-       if ( copy( "{$sdir}/{$name}", $d ) ) {
+       $d = "{$ddir}/{$dname}";
+       if ( copy( "{$sdir}/{$sname}", $d ) ) {
                if ( isset( $wgInstallOwner ) ) { chown( $d, $wgInstallOwner ); }
                if ( isset( $wgInstallGroup ) ) { chgrp( $d, $wgInstallGroup ); }
                chmod( $d, $perms );
-               # print "Copied \"{$name}\" to \"{$ddir}\".\n";
+               # print "Copied \"{$sname}\" to \"{$d}\".\n";
        } else {
-               print "Failed to copy file \"{$name}\" to \"{$ddir}\".\n";
+               print "Failed to copy file \"{$sname}\" to \"{$ddir}/{$dname}\".\n";
                exit();
        }
 }
index e45b0c0..4aef3d8 100644 (file)
@@ -48,9 +48,8 @@ print "Copying files...\n";
 
 copyfile( ".", "LocalSettings.php", $IP );
 copyfile( ".", "Version.php", $IP );
-copyfile( ".", "wiki.phtml", $IP );
-copyfile( ".", "redirect.phtml", $IP );
-copyfile( ".", "texvc.phtml", $IP );
+copyfileto( ".", "wiki.phtml", $IP, "wiki.$wgScriptExtension" );
+copyfileto( ".", "redirect.phtml", $IP, "redirect.$wgScriptExtension" );
 
 copydirectory( "./includes", $IP );
 copydirectory( "./stylesheets", $wgStyleSheetDirectory );
index e4ae187..bef4e9b 100644 (file)
@@ -72,11 +72,11 @@ exit();
 
 function do_update_files() {
        global $IP, $wgStyleSheetDirectory, $wgUploadDirectory, $wgLanguageCode, $wgDebugLogFile;
+       global $wgScriptExtension;
        print "Copying files... ";
        
-       copyfile( ".", "wiki.phtml", $IP );
-       copyfile( ".", "redirect.phtml", $IP );
-       copyfile( ".", "texvc.phtml", $IP );
+       copyfileto( ".", "wiki.phtml", $IP, "wiki.$wgScriptExtension" );
+       copyfileto( ".", "redirect.phtml", $IP, "redirect.$wgScriptExtension" );
        
        copydirectory( "./includes", $IP );
        copydirectory( "./stylesheets", $wgStyleSheetDirectory );